package com.zxy;

public class IsPrime {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 20000; i++) {
            if (isPrime(i)) {
                if(count++ % 5 == 0){
                    System.out.println();
                }
                System.out.print(i + " ");
            }
        }
    }
    public static boolean isPrime(int n){
        if(n <= 1){
            return false;
        }
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if(n % i == 0){
                return false;
            }
        }
        return true;
    }
}
